package com.minelx.statementsplus.cha.core;

import java.util.Objects;

public final class TaskCommitment {
	private final String loopId;
	private final String majorSql;
	private final String childSql;
	private final String additionalValues;
	private final String multipleValues;

	public TaskCommitment(String loopId, String majorSql, String childSql, String additionalValues, String multipleValues) {
		this.loopId = loopId;
		this.majorSql = majorSql;
		this.childSql = childSql;
		this.additionalValues = additionalValues;
		this.multipleValues = multipleValues;
	}

	public String loopId() {
		return loopId;
	}

	public String majorSql() {
		return majorSql;
	}

	public String childSql() {
		return childSql;
	}

	public String additionalValues() {
		return additionalValues;
	}

	public String multipleValues() {
		return multipleValues;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == this) return true;
		if (obj == null || obj.getClass() != this.getClass()) return false;
		TaskCommitment that = (TaskCommitment) obj;
		return Objects.equals(this.loopId, that.loopId) &&
				Objects.equals(this.majorSql, that.majorSql) &&
				Objects.equals(this.childSql, that.childSql) &&
				Objects.equals(this.additionalValues, that.additionalValues) &&
				Objects.equals(this.multipleValues, that.multipleValues);
	}

	@Override
	public int hashCode() {
		return Objects.hash(loopId, majorSql, childSql, additionalValues, multipleValues);
	}

	@Override
	public String toString() {
		return "TaskCommitment[" +
				"loopId=" + loopId + ", " +
				"majorSql=" + majorSql + ", " +
				"childSql=" + childSql + ", " +
				"additionalValues=" + additionalValues + ", " +
				"multipleValues=" + multipleValues + ']';
	}
}